package com.qingcloud.api.dcengine.service;

import com.qingcloud.api.dcengine.dto.TablePageDTO;
import com.qingcloud.api.dcengine.dto.point.PointDensity;
import com.qingcloud.api.dcengine.model.point.PointDensityListParam;
import com.qingcloud.api.dcengine.model.point.PointDensityPageParam;
import com.qingcloud.api.dcengine.service.fallback.DischargeDensityApiFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.Collection;
import java.util.List;
import java.util.Map;

/**
 * 水综合治理-断面监测数据接口
 *
 * @author wangjinnan
 */
@FeignClient(name = "point-density-api", url = "${data-url}",
        fallback = DischargeDensityApiFallback.class)
public interface PointDensityApi {

    /**
     * 断面最新数据
     */
    @PostMapping("/point/uptodateData/list")
    List<PointDensity> uptodateData(@RequestBody PointDensityListParam listParam);


    /**
     * 断面小时数据列表
     */
    @PostMapping("/point/hour/list")
    List<PointDensity> hourList(@RequestBody PointDensityListParam listParam);

    /**
     * 断面小时数据 分页查询
     */
    @PostMapping("/point/hour/page")
    TablePageDTO<PointDensity> hourPage(@RequestBody PointDensityPageParam pageParam);

    /**
     * 断面天数据列表
     */
    @PostMapping("/point/day/list")
    List<PointDensity> dayList(@RequestBody PointDensityListParam listParam);

    /**
     * 断面天平均值数据列表
     */
    @PostMapping("/point/day/avglist")
    List<PointDensity> dayAvgList(@RequestBody PointDensityListParam listParam);

    /**
     * 断面天数据 分页查询
     */
    @PostMapping("/point/day/page")
    TablePageDTO<PointDensity> dayPage(@RequestBody PointDensityPageParam pageParam);

    /**
     * 查询断面监测数据数量
     */
    @PostMapping("/point/data/number")
    Integer dataCount(@RequestBody PointDensityListParam listParam);


    /**
     * 查询每个断面的最新监测时间
     */
    @PostMapping("/point/data/maxTime")
    Map<String,String> maxTime(@RequestBody Collection<String> pointCodes);

    /**
     * 查询月平均值
     */
    @PostMapping("/point/data/monthAvg")
    List<PointDensity> monthAvg(@RequestBody PointDensityListParam listParam);
}
